const increment = state => {
  state.home.count++;
};

const getCount = state => {
  state.home.result = 15;
};

const mutations = {
  getCount,
  increment
};

const actions = {
  increment: ({ commit }) => {
    setTimeout(() => {
      commit("increment");
    }, 1000);
  },
  getCount: (context, callback) => {
    setTimeout(() => {
      context.commit("getCount");
      callback();
    }, 3000);
  }
};

export default {
  actions,
  mutations
};
